#ifndef WIDGET_H
#define WIDGET_H

#include <iostream>

#include "web.h"
#include "store.h"

#include <QWidget>
#include <QPushButton>
#include <QLayout>
#include <QPaintEvent>
#include <QPainter>
#include <QStyleOption>
#include <QToolBar>
#include <QLabel>
#include <QPoint>
#include <QRect>
#include <QSize>

// 程序主界面
QT_BEGIN_NAMESPACE
namespace Ui {
class Widget;
}
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT
    Web *www = new Web;
    Store *storeWidget;
public:
    Widget(QWidget *parent = nullptr);
    ~Widget();    
    QIcon setIconColor(QIcon icon, QColor color);
    void reSizeMainContainer();

private:
    Ui::Widget *ui;
    QPushButton *quitButton;
    QLabel *SysIcon;
    QLabel *SysTitle;
    QToolBar *SysToolBar;
    QAction *minWindow;
    QAction *maxWindow;
    QAction *endWindow;
    QPoint m_Position;
    bool m_flag = false;
    bool isfull = false;

protected:
    // void showEvent(QShowEvent *event);
    void resizeEvent(QResizeEvent *event);
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);
    void titleBarEvent(QAction *event);
};

#endif // WIDGET_H
